﻿@model IEnumerable<WebInstagram.Models.Photo>
@{
    ViewBag.Title = ViewBag.UserName + " photos";
}

<style type="text/css">
    .hoverimg {
        cursor: hand;
        cursor: pointer;
    }
</style>
<div class="row">
    <div class="col-md-12">
        <h2>@ViewBag.UserName Photos</h2>
        @if (ViewBag.UserName == User.Identity.Name)
        {
            <p><a class="btn btn-default" href="~/Home/UploadPhoto">Upload Photo &raquo;</a></p>
        }
        @foreach (var photo in Model)
        {
            <a href="~/Photo/Details/@photo.Id">

                <img src="data:image/jpg;base64,@(Convert.ToBase64String(photo.Image))"
                     style="width:160px; height:200px"
                     class="hoverimg" />
            </a>
        }

    </div>
</div>